import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Card } from 'antd';
import moment from 'moment';
import DescriptionList from '@/components/DescriptionList';

const { Description } = DescriptionList;
@connect(({ integratedquery, loading }) => ({
  loading: loading.models.integratedquery,
  empBaseInfo: integratedquery.empBaseInfo, // 员工基本信息
}))
@Form.create()
class EmpInfor extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {}

  render() {
    const { empBaseInfo } = this.props;
    return (
      <div>
        <Card
          style={{ marginBottom: 12 }}
          title={<span style={{ fontWeight: 'bolder' }}>员工基本信息</span>}
          bordered={false}
          id="basicinfor"
        >
          <DescriptionList>
            <Description term="姓名">{empBaseInfo.empName || '--'}</Description>
            <Description term="证件类型">{empBaseInfo.cardTypeName || '--'}</Description>
            <Description term="证件号">{empBaseInfo.cardNo || '--'}</Description>
            <Description term="性别">{empBaseInfo.genderName || '--'}</Description>
            <Description term="国籍">{empBaseInfo.nationName || '--'}</Description>
            <Description term="出生日期">
              {empBaseInfo.birthDate ? moment(empBaseInfo.birthDate).format('YYYY-MM-DD') : '--'}
            </Description>
            <Description term="电话">{empBaseInfo.mobile || '--'}</Description>
            <Description term="员工邮箱">{empBaseInfo.email || '--'}</Description>
            <Description term="在职状态">{empBaseInfo.sendStatusName || '--'}</Description>
          </DescriptionList>
        </Card>
      </div>
    );
  }
}

export default EmpInfor;
